package com.anonymous.community.hotfix;

/**
 * 热更新配置类
 * 包含热更新相关的配置常量
 */
public class HotfixConfig {
    
    // 服务器配置
    public static final String SERVER_URL = "https://your-server.com/api/";
    public static final String CHECK_UPDATE_URL = SERVER_URL + "hotfix/check";
    
    // 应用信息
    public static final String PACKAGE_NAME = "com.anonymous.community";
    public static final String APP_VERSION = "1.0.0";
    
    // 补丁存储目录
    public static final String PATCH_DIR = "tinker_patch";
    
    // 补丁文件前缀
    public static final String PATCH_FILE_PREFIX = "patch_";
    
    // 热更新开关
    private static boolean isHotfixEnabled = false;
    
    // WiFi环境自动下载（默认开启静默更新）
    private static boolean autoDownloadOnWifi = false;
    
    // 检查更新间隔（毫秒）
    public static final long CHECK_INTERVAL = 24 * 60 * 60 * 1000; // 24小时
    
    // 连接超时时间（毫秒）
    public static final int CONNECT_TIMEOUT = 10000; // 10秒
    
    // 读取超时时间（毫秒）
    public static final int READ_TIMEOUT = 30000; // 30秒
    
    public static boolean isHotfixEnabled() {
        return isHotfixEnabled;
    }
    
    public static void setHotfixEnabled(boolean enabled) {
        isHotfixEnabled = enabled;
    }
    
    public static boolean isAutoDownloadOnWifi() {
        return autoDownloadOnWifi;
    }
    
    public static void setAutoDownloadOnWifi(boolean autoDownload) {
        autoDownloadOnWifi = autoDownload;
    }
}